import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
import re
testCase="DBshop005_订单管理查询流程"
# 查看已存订单号
rootpath=get_pro_rootpath()
orderID=readFile(rootpath+r".\public\order004.txt")
# 1.点击销售管理订单管理界面。
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,"销售管理","订单管理")
# 2.在订单号查询框输入“1666421357040025”，点击“搜索”按钮。
DBshopSearchOrderID(firefox,orderID)
# 断言
order=firefox.find_element_by_xpath("//table/tbody/tr[2]").text
if re.search(orderID,order):
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试失败" % testCase)
getPhoto(firefox)
firefox.quit()